$(function(){
	var w_width=$(window).width();
	var w_banner=(1920-w_width)/2;
	// $('.flexslider .slides img').css('margin-left','-'+w_banner+'px');
	// $('.banner_s img').css('margin-left','-'+w_banner+'px');
	
	$('.nav_m .n_icon').click(function(){
		$(this).siblings('ul').slideToggle();
	});
	
	$('.i_mb ul li:nth-child(5n)').css('margin-right',0+'px');
	$('.i_mc ul li:nth-child(5n)').css('margin-right',0+'px');
	$('.i_md ul li:nth-child(4n)').css('margin-right',0+'px');
	$('.pro li:nth-child(3n)').css('margin-right',0+'px');
	
	
})
//jquery.tools.packed.js
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.C=$.C||{20:\'1.2.5\'};$.C.9={N:{9:\'a\',u:\'u\',1p:Z,1V:Z,25:\'28\',I:0,1i:\'o\',2a:H,q:H},2f:3(a,b){h[a]=b}};8 h={\'28\':3(i,a){7.O().1B().p(i).2i();a.1I()},3l:3(i,a){8 b=7.1M(),1e=b.3j,B=7.O();4(1e){B.3i(1e)}S{B.1B()}B.p(i).3h(b.3d,a)},3b:3(i,a){7.O().2N(2M);7.O().p(i).2K(2C,a)},2G:3(i,a){7.O().p(0).2I(7.2v().p(i).1h("J"),a)}};8 w;$.C.9.2f("2P",3(i,a){4(!w){w=7.O().p(0).1b()}7.2t().1T({1b:0},3(){$(7).1B()});7.O().p(i).1T({1b:w},3(){$(7).2i();a.1I()})});3 2o(c,d,f){8 g=7,P=c.17(7),9=c.A(f.9),B=d.1j?d:c.14(d),u;4(!9.z){9=c.14()}4(!B.z){B=c.1F().A(d)}4(!B.z){B=$(d)}$.1a(7,{o:3(i,e){8 a=9.p(i);4(1H i==\'2l\'&&i.1s("#","")){a=9.1L("[J*="+i.1s("#","")+"]");i=3a.3p(9.L(a),0)}4(f.2a){8 b=9.z-1;4(i<0){6 g.o(b,e)}4(i>b){6 g.o(0,e)}}4(!a.z){4(u>=0){6 g}i=f.I;a=9.p(i)}4(i===u){6 g}e=e||$.2h();e.2g="1p";P.P(e,[i]);4(e.12()){6}h[f.25].1I(g,i,3(){e.2g="1V";P.P(e,[i])});u=i;9.1U(f.u);a.13(f.u);6 g},1M:3(){6 f},2v:3(){6 9},O:3(){6 B},2t:3(){6 B.p(u)},3q:3(){6 9.p(u)},2e:3(){6 u},D:3(){6 g.o(u+1)},R:3(){6 g.o(u-1)},2d:3(){9.2c(f.1i).1U(f.u);B.A("a[J^=#]").2c("o.T");6 g}});$.K("1p,1V".3s(","),3(i,b){4($.1D(f[b])){$(g).V(b,f[b])}g[b]=3(a){4(a){$(g).V(b,a)}6 g}});4(f.q&&$.W.q){$.C.q.3u(9);f.1i=\'q\'}9.K(3(i){$(7).V(f.1i,3(e){g.o(i,e);6 e.18()})});B.A("a[J^=#]").V("o.T",3(e){g.o($(7).1h("J"),e)});4(1c.1d&&f.9=="a"&&c.A("[J="+1c.1d+"]").z){g.o(1c.1d)}S{4(f.I===0||f.I>0){g.o(f.I)}}}$.W.9=3(a,b){8 c=7.16("9");4(c){c.2d();7.3w("9")}4($.1D(b)){b={1p:b}}b=$.1a({},$.C.9.N,b);7.K(3(){c=22 2o($(7),a,b);$(7).16("9",c)});6 b.1n?c:7}})(1o);(3($){$.C=$.C||{20:\'1.2.5\'};$.C.E={N:{1O:\'21\',X:H,19:\'3A\',1r:\'3x\',1Z:\'2H\',I:0,1Y:Z,1W:\'.1W\',1t:11,1f:H,D:\'.D\',R:\'.R\',1K:1,1e:2C,Q:H,23:11,24:0}};3 3v(a,b){8 v=27(a.3t(b),10);4(v){6 v}8 s=a[0].3r;6 s&&s.1b&&27(s.1b,10)}3 A(a,b){8 c=$(b);6 c.z<2?c:a.1F().A(b)}8 n;3 2b(f,g){8 h=7,1m=f.17(h),r=f.14(),L=0,Q=g.Q;4(!n){n=h}4(r.z>1){r=$(g.1W,f)}$.1a(h,{1M:3(){6 g},2e:3(){6 L},15:3(){6 h.U().1K()},1l:3(){6 l.17(D)},1N:3(){6 f},3f:3(){6 r},U:3(){6 r.14(g.1Y).3c("."+g.19)},Y:3(a,b){6 h.G(L+a,b)},D:3(a){6 h.Y(1,a)},R:3(a){6 h.Y(-1,a)},2m:3(a){6 h.G(0,a)},2n:3(a){6 h.G(h.15()-1,a)},35:3(){n=h;6 h},1k:3(a){a=$(a);4(!g.X){r.2W(a)}S{r.14("."+g.19+":2V").2T(a);r.14("."+g.19+":2R").2Q(a.1S().13(g.19))}1m.P("1Q",[a]);6 h},G:3(i,a,b){4(!i.1j){i*=1}4(g.X&&i===0&&L==-1&&a!==0){6 h}4(!g.X&&i<0||i>h.15()||i<-1){6 h}8 c=i;4(i.1j){i=h.U().L(i)}S{c=h.U().p(i)}8 e=$.2h("1g");4(!b){1m.P(e,[i,a]);4(e.12()||!c.z){6 h}}8 d=Q?{2w:-c.2x().2w}:{2y:-c.2x().2y};L=i;n=h;4(a===2O){a=g.1e}r.1T(d,a,g.1Z,b||3(){1m.P("2z",[i])});6 h}});$.K([\'1g\',\'2z\',\'1Q\'],3(i,b){4($.1D(g[b])){$(h).V(b,g[b])}h[b]=3(a){4(a){$(h).V(b,a)}6 h}});4(g.X){8 j=h.U();8 k=j.36(-1).1S().2E(r),1E=j.1L(":2F("+g.1K+")").1S().2B(r);j=Z;k.17(1E).13(g.19);h.1g(3(e,i,a){4(e.12()){6}4(i==-1){h.G(k,a,3(){h.2n(0)});6 e.18()}S 4(i==h.15()){h.G(1E,a,3(){h.2m(0)})}});h.G(0,0,3(){})}8 l=A(f,g.R).o(3(){h.R()}),D=A(f,g.D).o(3(){h.D()});4(!g.X&&h.15()>1){h.1g(3(e,i){1X(3(){4(!e.12()){l.2A(g.1r,i<=0);D.2A(g.1r,i>=h.15()-1)}},1)});4(!g.I){l.13(g.1r)}}4(g.1f&&$.W.1f){f.1f(3(e,a){4(g.1f){h.Y(a<0?1:-1,g.24||2J);6 H}})}4(g.23){8 m={};r[0].2L=3(e){8 t=e.1A[0];m.x=t.2u;m.y=t.2s};r[0].2S=3(e){4(e.1A.z==1&&!r.2r(":2U")){8 t=e.1A[0],2q=m.x-t.2u,2p=m.y-t.2s;h[Q&&2p>0||!Q&&2q>0?\'D\':\'R\']();e.18()}}}4(g.1t){$(2X).V("2Y.E",3(a){4(!g.1t||a.2Z||a.30||$(a.31).2r(":32")){6}4(g.1t!=\'33\'&&n!=h){6}8 b=a.34;4(Q&&(b==38||b==2D)){h.Y(b==38?-1:1);6 a.18()}4(!Q&&(b==37||b==39)){h.Y(b==37?-1:1);6 a.18()}})}4(g.I){h.G(g.I,0,3(){})}}$.W.E=3(a){8 b=7.16("E");4(b){6 b}a=$.1a({},$.C.E.N,a);7.K(3(){b=22 2b($(7),a);$(7).16("E",b)});6 a.1n?b:7}})(1o);(3($){8 t=$.C.E;t.1z={N:{2k:11,1y:3e,2j:11}};$.W.1z=3(c){4(1H c==\'3g\'){c={1y:c}}8 d=$.1a({},t.1z.N,c),1x;7.K(3(){8 a=$(7).16("E");4(a){1x=a}8 b,1v=11;a.1R=3(){4(b){6}1v=H;b=3k(3(){a.D()},d.1y)};a.1J=3(){b=3m(b)};a.3n=3(){a.1J();1v=11};4(d.2j){a.1N().17(a.1l()).3o(a.1J,a.1R)}4(d.2k){a.1R()}});6 d.1n?1x:7}})(1o);(3($){8 t=$.C.E;t.1G={N:{F:\'.F\',1C:Z,1O:\'21\',29:H,1w:Z,q:H}};3 A(a,b){8 c=$(b);6 c.z<2?c:a.1F().A(b)}$.W.1G=3(f){4(1H f==\'2l\'){f={F:f}}f=$.1a({},t.1G.N,f);8 g;7.K(3(){8 d=$(7).16("E"),F=f.F.1j?f.F:A(d.1N(),f.F),26=d.1l(),1q=f.1O,q=f.q&&$.W.q;4(d){g=d}d.1l=3(){6 26.17(F)};3 1P(a,i,e){d.G(i);4(q){4(1c.1d){1c.1d=a.1h("J").1s("#","")}}S{6 e.18()}}3 M(){6 F.A(f.1C||\'> *\')}3 1k(i){8 a=$("<"+(f.1C||\'a\')+"/>").o(3(e){1P($(7),i,e)}).1h("J","#"+i);4(i===0){a.13(1q)}4(f.29){a.3y(i+1)}4(f.1w){a.1h("3z",f.1w+i)}6 a.2B(F)}4(M().z){M().K(3(i){$(7).o(3(e){1P($(7),i,e)})})}S{$.K(d.U(),3(i){1k(i)})}d.1g(3(e,b){1X(3(){4(!e.12()){8 a=M().p(b);4(!e.12()&&a.z){M().1U(1q).p(b).13(1q)}}},1)});3 1u(a,b){8 c=M().p(b.1s("#",""));4(!c.z){c=M().1L("[J="+b+"]")}c.o()}d.1Q(3(e,a){a=1k(d.U().L(a));4(q){a.q(1u)}});4(q){M().q(1u)}});6 f.1n?g:7}})(1o);',62,223,'|||function|if||return|this|var|tabs|||||||||||||||click|eq|history|itemWrap|||current|||||length|find|panes|tools|next|scrollable|navi|seekTo|false|initialIndex|href|each|index|els|conf|getPanes|trigger|vertical|prev|else||getItems|bind|fn|circular|move|null||true|isDefaultPrevented|addClass|children|getSize|data|add|preventDefault|clonedClass|extend|width|location|hash|speed|mousewheel|onBeforeSeek|attr|event|jquery|addItem|getNaviButtons|fire|api|jQuery|onBeforeClick|cls|disabledClass|replace|keyboard|doHistory|stopped|idPrefix|ret|interval|autoscroll|touches|hide|naviItem|isFunction|cloned2|parent|navigator|typeof|call|pause|size|filter|getConf|getRoot|activeClass|doClick|onAddItem|play|clone|animate|removeClass|onClick|items|setTimeout|item|easing|version|active|new|touch|wheelSpeed|effect|buttons|parseInt|default|indexed|rotate|Scrollable|unbind|destroy|getIndex|addEffect|type|Event|show|autopause|autoplay|string|begin|end|Tabs|deltaY|deltaX|is|clientY|getCurrentPane|clientX|getTabs|top|position|left|onSeek|toggleClass|appendTo|400|40|prependTo|lt|ajax|swing|load|50|slideDown|ontouchstart|200|slideUp|undefined|horizontal|replaceWith|first|ontouchmove|before|animated|last|append|document|keydown|altKey|ctrlKey|target|input|static|keyCode|focus|slice||||Math|slide|not|fadeInSpeed|3000|getItemWrap|number|fadeIn|fadeOut|fadeOutSpeed|setInterval|fade|clearInterval|stop|hover|max|getCurrentTab|currentStyle|split|css|init|dim|removeData|disabled|text|id|cloned'.split('|'),0,{}));
function ZoomPic ()
{
	this.initialize.apply(this, arguments)	
}
ZoomPic.prototype = 
{
	initialize : function (id)
	{
		var _this = this;
		this.wrap = typeof id === "string" ? document.getElementById(id) : id;
		this.oUl = this.wrap.getElementsByTagName("ul")[0];
		this.aLi = this.wrap.getElementsByTagName("li");
		this.prev = this.wrap.getElementsByTagName("span")[0];
		this.next = this.wrap.getElementsByTagName("span")[1];
		this.timer = 1000;
		this.aSort = [];
		this.iCenter = 2;
		this._doPrev = function () {return _this.doPrev.apply(_this)};
		this._doNext = function () {return _this.doNext.apply(_this)};
		this.options = [
			/*{width:476, height:210, top:40, left:0, zIndex:1},
			{width:426, height:250, top:20, left:50, zIndex:2},
			{width:654, height:290, top:0, left:150, zIndex:3},
			{width:426, height:250, top:20, left:480, zIndex:2},
			{width:476, height:210, top:40, left:476, zIndex:1},*/
			{width:365, height:180, top:40, left:0, zIndex:1},
			{width:405, height:210, top:20, left:150, zIndex:2},
			{width:445, height:242, top:0, left:300, zIndex:3},
			{width:405, height:210, top:20, left:500, zIndex:2},
			{width:366, height:180, top:40, left:700, zIndex:1},
		];
		for (var i = 0; i < this.aLi.length; i++) this.aSort[i] = this.aLi[i];
		this.aSort.unshift(this.aSort.pop());
		this.setUp();
		this.addEvent(this.prev, "click", this._doPrev);
		this.addEvent(this.next, "click", this._doNext);
		this.doImgClick();		
		this.timer = setInterval(function ()
		{
			_this.doNext()	
		}, 3000);		
		this.wrap.onmouseover = function ()
		{
			clearInterval(_this.timer)	
		};
		this.wrap.onmouseout = function ()
		{
			_this.timer = setInterval(function ()
			{
				_this.doNext()	
			}, 3000);	
		}
	},
	doPrev : function ()
	{
		this.aSort.unshift(this.aSort.pop());
		this.setUp()
	},
	doNext : function ()
	{
		this.aSort.push(this.aSort.shift());
		this.setUp()
	},
	doImgClick : function ()
	{
		var _this = this;
		for (var i = 0; i < this.aSort.length; i++)
		{
			this.aSort[i].onclick = function ()
			{
				if (this.index > _this.iCenter)
				{
					for (var i = 0; i < this.index - _this.iCenter; i++) _this.aSort.push(_this.aSort.shift());
					_this.setUp()
				}
				else if(this.index < _this.iCenter)
				{
					for (var i = 0; i < _this.iCenter - this.index; i++) _this.aSort.unshift(_this.aSort.pop());
					_this.setUp()
				}
			}
		}
	},
	setUp : function ()
	{
		var _this = this;
		var i = 0;
		for (i = 0; i < this.aSort.length; i++) this.oUl.appendChild(this.aSort[i]);
		for (i = 0; i < this.aSort.length; i++)
		{
			this.aSort[i].index = i;
			if (i < 5)
			{
				this.css(this.aSort[i], "display", "block");
				this.doMove(this.aSort[i], this.options[i], function ()
				{
					_this.doMove(_this.aSort[_this.iCenter].getElementsByTagName("img")[0], {opacity:100}, function ()
					{
						_this.doMove(_this.aSort[_this.iCenter].getElementsByTagName("img")[0], {opacity:100}, function ()
						{
							_this.aSort[_this.iCenter].onmouseover = function ()
							{
								_this.doMove(this.getElementsByTagName("div")[0], {bottom:0})
							};
							_this.aSort[_this.iCenter].onmouseout = function ()
							{
								_this.doMove(this.getElementsByTagName("div")[0], {bottom:-100})
							}
						})
					})
				});
			}
			else
			{
				this.css(this.aSort[i], "display", "none");
				this.css(this.aSort[i], "width", 0);
				this.css(this.aSort[i], "height", 0);
				this.css(this.aSort[i], "top", 37);
				this.css(this.aSort[i], "left", this.oUl.offsetWidth / 2)
			}
			if (i < this.iCenter || i > this.iCenter)
			{
				this.css(this.aSort[i].getElementsByTagName("img")[0], "opacity", 100)
				this.aSort[i].onmouseover = function ()
				{
					_this.doMove(this.getElementsByTagName("img")[0], {opacity:100})	
				};
				this.aSort[i].onmouseout = function ()
				{
					_this.doMove(this.getElementsByTagName("img")[0], {opacity:100})
				};
				this.aSort[i].onmouseout();
			}
			else
			{
				this.aSort[i].onmouseover = this.aSort[i].onmouseout = null
			}
		}		
	},
	addEvent : function (oElement, sEventType, fnHandler)
	{
		return oElement.addEventListener ? oElement.addEventListener(sEventType, fnHandler, false) : oElement.attachEvent("on" + sEventType, fnHandler)
	},
	css : function (oElement, attr, value)
	{
		if (arguments.length == 2)
		{
			return oElement.currentStyle ? oElement.currentStyle[attr] : getComputedStyle(oElement, null)[attr]
		}
		else if (arguments.length == 3)
		{
			switch (attr)
			{
				case "width":
				case "height":
				case "top":
				case "left":
				case "bottom":
					oElement.style[attr] = value + "px";
					break;
				case "opacity" :
					oElement.style.filter = "alpha(opacity=" + value + ")";
					oElement.style.opacity = value / 100;
					break;
				default :
					oElement.style[attr] = value;
					break
			}	
		}
	},
	doMove : function (oElement, oAttr, fnCallBack)
	{
		var _this = this;
		clearInterval(oElement.timer);
		oElement.timer = setInterval(function ()
		{
			var bStop = true;
			for (var property in oAttr)
			{
				var iCur = parseFloat(_this.css(oElement, property));
				property == "opacity" && (iCur = parseInt(iCur.toFixed(2) * 100));
				var iSpeed = (oAttr[property] - iCur) / 5;
				iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);
				
				if (iCur != oAttr[property])
				{
					bStop = false;
					_this.css(oElement, property, iCur + iSpeed)
				}
			}
			if (bStop)
			{
				clearInterval(oElement.timer);
				fnCallBack && fnCallBack.apply(_this, arguments)	
			}
		}, 30)
	}
};
window.onload = function ()
{
	new ZoomPic("focus_Box");
};


